WebSocketFramesStream

class WebSocketFramesStream(webSocketUri: String, framesBufferSize: Int, mapper: FrameMapper, webSocketClient: OkHttpClient) : WebSocketListener, Closeable, AutoCloseable

WebSocketFramesStream represents connection to remote WebSocket endpoint of the DevTools Protocol (either inspectable page debugger url http://localhost:9222/json or browser debugger url http://localhost:9222/json/version)

Parameters

webSocketUri

WebSocket debugger uri to connect to

framesBufferSize

Frames buffer size (how many ResponseFrames will be replayed prior to subscribing to stream)

mapper

FrameMapper that will serialize/deserialize frames exchanged by protocol

webSocketClient

WebSocket client for exchanging WebSocket frames.

Constructors

WebSocketFramesStream
Link copied to clipboard
fun WebSocketFramesStream(webSocketUri: String, framesBufferSize: Int, mapper: FrameMapper, webSocketClient: OkHttpClient)
WebSocket debugger uri to connect to

Types

Companion
Link copied to clipboard
object Companion

Functions

close
Link copied to clipboard
open override fun close()
Closes WebSocket connection.
eventFrames
Link copied to clipboard
fun eventFrames(): Flowable<EventResponseFrame>
Returns all frames that represent events from WebSocket connection.
frames
Link copied to clipboard
fun frames(): Flowable<WebSocketFrame>
Returns all frames received from WebSocket connection.
getResponse
Link copied to clipboard
fun <T> getResponse(requestFrame: RequestFrame, serializer: KSerializer<T>): Single<T>
Returns protocol response for given request frame (if any).
onClosed
Link copied to clipboard
open override fun onClosed(webSocket: WebSocket, code: Int, reason: String)
onClosed is called when WebSocket is being closed.
onClosing
Link copied to clipboard
open fun onClosing(webSocket: WebSocket, code: Int, reason: String)
onFailure
Link copied to clipboard
open override fun onFailure(webSocket: WebSocket, t: Throwable, response: Response?)
onFailure is called when WebSocket protocol error occurs.
onMessage
Link copied to clipboard
open fun onMessage(webSocket: WebSocket, bytes: ByteString)
open override fun onMessage(webSocket: WebSocket, text: String)
onMessage is called when new frame arrives on WebSocket.
onOpen
Link copied to clipboard
open fun onOpen(webSocket: WebSocket, response: Response)
send
Link copied to clipboard
fun send(frame: RequestFrame): Single<Boolean>
Sends frame over the WebSocket connection.

Sources

jvm source
Link copied to clipboard